# Contributor: rubicon <rubicon@mailo.com>
# Maintainer: rubicon <rubicon@mailo.com>
pkgname=tcl-readline
_pkgname=${pkgname//-/}
pkgver=2.3.8
pkgrel=0
pkgdesc="GNU readline for Tcl"
url="https://github.com/flightaware/tclreadline"
arch="all"
license="BSD-3-Clause"
depends_dev="$pkgname"
makedepends="tcl-dev readline-dev"
options="!check"
subpackages="$pkgname-doc $pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/flightaware/tclreadline/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--without-tk
	make
}

dev() {
	default_dev
	mv "$subpkgdir"/usr/lib/libtclreadline.so "$pkgdir"/usr/lib
}

package() {
	make DESTDIR="$pkgdir" install
	install -vDm644 -t "$pkgdir"/usr/share/doc/"$pkgname" \
		AUTHORS COPYING ChangeLog INSTALL \
		README.md SCENARIO TODO sample.tclshrc
}

sha512sums="
0c5ce53a8f4cc222de013932698e442c63b36e3f07d10b962d127444f75c28b2caf7f06b5958150748f7a1d535c577c825b9a0dd525e077a348c3ff899a74e61  tcl-readline-2.3.8.tar.gz
"
